//
//  MBPageTableViewModel.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/18.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBPageTableViewModel.h"

@interface MBPageTableViewModel ()
@property (nonatomic,assign) int currentPage; // 当前页面
@property (nonatomic,assign) BOOL isNeedHiddenFooter; // 根据totalcount判断是否需要进行footer的隐藏
@end

@implementation MBPageTableViewModel

- (void)setUpData{
    [super setUpData];
    [self initRequestPullPage];
}


- (void)initRequestPullPage{
    self.currentPage = 1;
}

- (void)factoryInitDataModelArray:(NSArray *)dataArray
                       totalCount:(int)totalCount
               cellViewModelClass:(Class)cellViewModelClass;
{
    if (self.currentPage == 1) {
        [self.dataArray removeAllObjects];
    }
    [self factoryInitDataModelArray:dataArray cellViewModelClass:cellViewModelClass];
    self.isNeedHiddenFooter = totalCount > dataArray.count;
    self.currentPage = self.currentPage+1;
}

@end
